<?
/**
 * @category   e-commerce
 * @package    Storage
 * @author     Alberto Pardo Saleme <apardo@adverit.com>
 * @copyright  2005 - AdVerit S.A. <www.adverit.com>
 * @version    Release: 1.0
 * @update     03/01/2006 03:09p.m.
 */


class StorageBuilder
{
	public function &build($storage, $name)
	{
		switch($storage)
		{
			case "session":
				require_once(dirname(__FILE__) ."/StorageSession.php");
				$storage = new StorageSession($name);
				break;
			case "mysql":
				require_once(dirname(__FILE__) ."/StorageMySQL.php");
				$storage = new StorageMysql($name);
				break;
			case "file":
				require_once(dirname(__FILE__) ."/StorageFile.php");
				$storage = new StorageFile($name);
				break;
			default:
				require_once(dirname(__FILE__) ."/Storage.php");
				$storage = new Storage($name);
		}
		return $storage;
	}
}

?>
